package org.lmd.platform.dao.sys;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.lmd.platform.entity.sys.RoleDeptEntity;
import org.lmd.platform.entity.sys.RoleEntity;
import org.lmd.platform.entity.sys.RoleMenuEntity;

import java.util.List;
import java.util.Map;

public interface RoleMapper extends BaseMapper<RoleEntity> {
    /**
     * 根据角色ID，获取菜单ID列表
     */
    List<Long> queryRoleMenuIdList(Long roleId);

    /**
     * 根据角色ID数组，批量删除
     */
    int deleteRoleMenusBatch(Long[] roleIds);

    /**
     * 查询角色，对应的机构
     */
    List<Long> queryRoleDeptIdList(Long[] roleIds);

    int deleteRoleDeptBatch(Long[] roleIds);

    boolean saveOrUpdateRoleMenus(List<Map<String, Long>> roleMenuList);

    boolean saveOrUpdateRoleDepts(List<Map<String, Long>> roleDeptList);

    int saveRole(RoleEntity roleEntity);

    int deleteRoleBatch(Long[] roleIds);
}
